package com.jinunn.common.exception;

import com.jinunn.common.result.Result;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.validation.valueextraction.ExtractedValue;

/**
 * @author : JinDun
 * @date : 2021/4/24 19:19
 */
@ExtractedValue
public class GlobalExceptionHander {


    @ExceptionHandler(Exception.class)
    @ResponseBody
    public Result execption(Exception e){
       e.printStackTrace();
       return Result.fail();
    }

    @ExceptionHandler(YyghException.class)
    @ResponseBody
    public Result execption(YyghException e){
        e.printStackTrace();
        return Result.fail();
    }
}
